<?php
class Permission_model extends CI_Model{
	public function getPermission($menu_link){
		
		$data = array();
		$u = $this->session->userdata('admin');
		
		$this->db->select('p.insert, p.delete, p.update');
		$this->db->from('permissions p');
		$this->db->where('username',$u);
		$this->db->join('menus m','m.id = p.menu_id AND m.link="'.$menu_link.'"');
		
		$q = $this->db->get();
		
		$data = $q->row_array();
		
		
		$q->free_result();
		return $data;
		
	}
}